#!/bin/bash
##
##Simple IF THEN
##
number=1
if [ $number = "1" ]; then
    echo "Number equals 1"
else
    echo "Number does not equal 1"
fi
##
if [ -f ~/.profile ]
then
	echo "Ban. co' file profile"
fi
##
##If - then - elif
##
if [ -f ~/.bashrc ];then	#neu' bieu? thuc' "-f ~/.bashrc" dung' thi` se~ bo? qua elif
	echo "Ban. co' file .bashrc"
elif [ -f ~/.profile ];then
	echo "Ban. co' file .profile"
else
	echo "Ban. hem co' gi"
fi
##
##CASE
##
echo -n "Enter a number between 1 and 3 inclusive > "
read character
case $character in
    1 ) echo "You entered one."
        ;;
    2 ) echo "You entered two."
        ;;
    3 ) echo "You entered three."
        ;;
    * ) echo "You did not enter a number"
        echo "between 1 and 3."
esac
##
##WHILE
##
number=0
while [ $number -lt 10 ]; do
    echo "Number = $number"
    number=$((number + 1))
done
##
##UNTIL
##
number=0
until [ $number -ge 10 ]; do
    echo "Number = $number"
    number=$((number + 1))
done
##
##FOR IN
##
for i in word1 word2 word3; do
    echo $i
done
